#ifndef RENDERABLE2008
#define RENDERABLE2008

#include "../GL/glut.h"
#include "stdio.h"

class Renderable
{
	void (*_render)(Renderable *);
	void (*_picRender)(Renderable *);
	
public:
	bool Visible;
	int ColorId;
	bool IsSelected;

	void SetRenderFunction(void (*render)(Renderable *))
	{
		_render = render;
	}

	void SetPicRenderFunction(void (*render)(Renderable *))
	{
		_picRender = render;
	}

	virtual void Render()
	{
		if(Visible)
			_render(this);
	}

	virtual void PicRender()
	{
		if(Visible && _picRender)
		{
			glColor3i(ColorId, 0, 0);
			_picRender(this);
		}
	}

	virtual void ProcessSelection(int Color)
	{
		printf("color: %d\n", Color);
		IsSelected = true;
	}

	Renderable()
	{
		_picRender = NULL;
		Visible = false;
		_render = NULL;
		ColorId = 0;
		IsSelected = false;
	}
};

#endif